<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="java.util.*"%>
<%@page import="comm.dhee.dto.T001"%>
<%@page import="comm.dhee.dto.T003"%>
<%@page import="comm.dhee.dto.M001"%>
<%@page import="comm.dhee.dto.T001T002"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>華信商会(株) 販売管理業務システム</title>
		<meta name="renderer" content="webkit">

		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/style.css" />
		<link rel="stylesheet" href="css/datetimepicker/bootstrap-datetimepicker.min.css" media="screen" />
	</head>

	<body>
	<%@include file="common/include.jsp"%>
		<!-- Body Begin -->
		<div class="container">
			<div class="row">
				<div class="col-md-12">
					<div class="row">
						<div class="col-md-12">
							<div class="panel panel-default">
								<div class="panel-heading">
									<div class="row">
										<div class="col-md-6" align="left">
											<font style="font-size: 14px;line-height: 29px;">請求書</font>
										</div>
									</div>
								</div>
								<div class="panel-body">
								 <%
								    String date1 =(String)request.getAttribute("data1");
								    String jine2 = (String)request.getAttribute("jine2");
								    String xiaof2 = (String)request.getAttribute("xiaof2");
								    String jiner2 = (String)request.getAttribute("jiner2");
									String gukecode =(String)request.getAttribute("gukecode");
									String kokyakuMei = (String)request.getAttribute("kokyakuMei");
									String qingqiudate  = (String)request.getAttribute("qingqiudate");
									String nounyuuHiduke = (String)request.getAttribute("nounyuuHiduke");
									String seikyuushoBangou1 = (String)request.getAttribute("seikyuushoBangou1");
								    List<String> lista = (List<String>)request.getSession().getAttribute("lista");
								    List<T001T002> listc = (List<T001T002>)request.getSession().getAttribute("listc");
								    String juchuuHiduke = (String)request.getAttribute("juchuuHiduke");
								%>
								<%-- <c:forEach var="c" items="${listc}">  --%>
									<table>
										<tr>
											<td width="500px" height="40px">請求書 コード :${seikyuushoBangou1}</td>
											<td>請求日付:${qingqiudate}</td>
										</tr>
										<tr>
											<td width="500px" height="40px">顧客 コード :${gukecode}</td>
											<td>顧客名:${kokyakuMei}</td>
										</tr>
										<tr>
											<td width="500px" height="20px"></td>
											<td></td>
										</tr>
									</table>
								<%-- </c:forEach> --%>
									<table class="table table-bordered" id="tabname" name="tabname">
										<thead>
											<tr>
												<th style="text-align:center;">項番</th>
												<th style="text-align:center;">受注 コード</th>
												<th style="text-align:center;">注文日付</th>
												<th style="text-align:center;">納品日付</th>
												<th style="text-align:center;">金額（税抜き）</th>
												<th style="text-align:center;">消費税</th>
												<th style="text-align:center;">金額（税込み）</th>
											</tr>
										</thead>
										 <c:forEach var="c" items="${listc}" varStatus="st">  
										 										
										<tbody>
											<tr>
												<td style="text-align:center;">${st.index+1}</td>
												<td style="text-align:center;">${c.juchuuCode}</td>
												<td style="text-align:center;">${juchuuHiduke}</td>
												<td style="text-align:center;">${qingqiudate}</td>
												<td style="text-align:center;">${jine2}</td>
												<td style="text-align:right;">${xiaof2}</td>
												<td style="text-align:right;">${jiner2}</td>
											</tr>
											 </c:forEach>
								
											<tr>
												<td colspan="7" style="text-align:right;">請求額合計:${sum2}</td>
											</tr>
											
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<%@include file="common/include2.jsp"%>
		<!-- Body End -->
		<script type="text/javascript">
		function tableAdd(tab,d){
			var s = 0;
			var tr = $(tab).find("tr");
			for(var i = 1;i<length-1;i++)
				s+= parseFloat(tr.eq(i).find("td").eq(d).text()) || 0;
				tr.eq(i).find("td").eq(d).text(s);
		}
		
		</script>
		<script type="text/javascript">
			//init datetimepicker
			$(".form_date").datetimepicker({
				language: 'ja',
				autoclose: true,
				todayHighlight: true,
				todayBtn: true,
				minView: "month",
				format: "yyyy-mm-dd",
				pickerPosition: "bottom-left"
			});
		</script>
	</body>

</html>